<template>
  <van-cell is-link center class="myCell">
    <template #title>
      <div class="title">
        {{ title }}
      </div>
    </template>
    <template #default>
      <img
        v-if="type === 'imge' && value"
        :src="baseURL + value"
        alt=""
        class="imge"
        center
      />
      <img
        v-else-if="type === 'imge' && !value"
        src="@/assets/曾小贤.jpg"
        alt=""
        class="imge"
      />
      <div v-else class="value">
        {{ value }}
      </div>
    </template>
    <template #icon>
      <i class="iconfont" v-html="icon"></i>
    </template>
  </van-cell>
</template>

<script>
export default {
  props: ['title', 'value', 'icon', 'type'],
  data () {
    return {
      baseURL: process.env.VUE_APP_URL
    }
  }
}
</script>

<style lang="less" scoped>
.myCell {
  .title {
    padding-left: 10px;
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #181a39;
    line-height: 20px;
    letter-spacing: 0px;
  }
  .value {
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: right;
    color: #5b5d75;
    line-height: 20px;
    letter-spacing: 0px;
  }
  .imge {
    height: 40px;
    width: 40px;
    border-radius: 50%;
  }
}
</style>
